package institutional

import java.util.Date;
import java.util.List;

import user.Professor
import user.Student
import util.Day;

/**
 * InscriptionService
 * A service class encapsulates the core business logic of a Grails application
 */
class InscriptionService {

    static transactional = true

	/** Metodos para ver Semestre*/
	def createSemester(int year, int semesterNumber) {
		Semester.last().setInscriptionAvailable(false)
		def semester = new Semester(year: year, semesterNumber: semesterNumber, inscriptionAvailable: false)
		semester.save()
	}
	
	def openInscription() {
		Semester.last().setInscriptionAvailable(true)
	}
		
	def closeInscription() {
		Semester.last().setInscriptionAvailable(false)
	}
	
	def getCurrentSemester () {
		Semester.last()
	}
	
	def isInscriptionOpen () {
		Semester.last().getInscriptionAvailable()
	}
	
	/** Metodos para alumnos*/
	def getMaxInscriptionNumber() {
		return 3 //cantidad maxima de inscripcion a cursos por cuatrimestre
	}
	

	
	
}
